package com.wyd.qxglmybatis.service;

import java.util.List;

import javax.annotation.Resource;

import com.wyd.qxglmybatis.dao.IRolesDao;
import com.wyd.qxglmybatis.model.Roles;

import org.springframework.stereotype.Service;

@Service
public class RolesServiceImpl implements IRolesService {

    @Resource
    private IRolesDao rolesDao;


    @Override
    public List<Roles> findAll() {
       


        return rolesDao.find();
    }

    @Override
    public int addOrEditRole(Roles r) {
        if(r.getId()!=null&&r.getId()!=""){
            return  rolesDao.editRole(r);


        }else{
            return rolesDao.addRole(r);
        }
    }

    @Override
    public int del(String id) {
     

        return rolesDao.del(id);
    }

    @Override
    public void deleteCTQ(String[] id) {
      
        rolesDao.deleteCTQ(id);

    }

    
    
}